/* 物体检测系统样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header h1 {
    font-size: 2rem;
    color: #2a5298;
    margin: 0;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-weight: 500;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4757;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #2ed573;
}

.stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    height: calc(100vh - 140px);
}

/* 视频容器样式 */
.video-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.video-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    min-height: 400px;
}

#videoStream {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.video-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* 视频控制按钮 */
.video-controls {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(244, 246, 249, 0.8);
    border-radius: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2a5298;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-section h3 {
    margin-bottom: 15px;
    color: #2a5298;
    font-size: 1.1rem;
}

/* 统计面板 */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item, .info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-item:last-child, .info-item:last-child {
    border-bottom: none;
}

.stat-label, .info-label {
    color: #666;
    font-size: 0.9rem;
}

.stat-value, .info-value {
    font-weight: 600;
    color: #2a5298;
}

/* 设置控件 */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 0.9rem;
}

.setting-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.setting-group span {
    font-weight: 600;
    color: #2a5298;
}

/* 控制开关组 */
.control-switches {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(244, 246, 249, 0.6);
    border-radius: 10px;
}

.control-switches .control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
}

.control-switches .control-group span {
    font-size: 0.9rem;
    color: #666;
}

/* 按钮样式 */
.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #2a5298;
    color: white;
}

.btn-primary:hover {
    background: #1e3c72;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f1f2f6;
    color: #57606f;
}

.btn-secondary:hover {
    background: #ddd;
    transform: translateY(-2px);
}

.btn-info {
    background: #3742fa;
    color: white;
}

.btn-info:hover {
    background: #2f3542;
    transform: translateY(-2px);
}

/* 动画 */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sidebar-section {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .status-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .video-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .sidebar {
        flex-direction: column;
    }
    
    .sidebar-section {
        min-width: auto;
    }
}